home *** CD-ROM | disk | FTP | other *** search
- /*
- ##########################################################################
- #### ####
- #### The MusicBox Project ####
- #### ============================ ####
- #### ####
- #### MusicBoxARexx.c ####
- #### ####
- #### Version 2.1os -- September 29, 2000 ####
- #### ####
- #### Copyright (C) 1994 Thomas Dreibholz ####
- #### 2000 Molbachweg 7 ####
- #### 51674 Wiehl ####
- #### Germany ####
- #### ####
- #### EMail: Dreibholz@bigfoot.com ####
- #### WWW: http://www.bigfoot.com/~dreibholz ####
- #### ####
- ##########################################################################
- */
- /***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-
- /* MusicBox ARexx-Port */
-
- #include "MusicBox.h"
-
- extern struct ThisCD *ThisCD;
- extern struct Einstellungen Einstellungen;
- extern struct MsgPort *ARexxPort;
- extern BOOL IsIconify;
-
- int ARexxHandler()
- {
- REGISTER LONG Res1,Res2;
- REGISTER LONG i,CmdCount,Pos;
- UBYTE Command[10][50];
- UBYTE c;
-
- struct RexxMsg *rx;
- int iconify;
-
- rx=GetMsg(ARexxPort);
- while(rx!=NULL)
- {
- /* --------------------------------------------------- */
- Pos=0;
- for(i=0,CmdCount=0;i<strlen(rx->rm_Args[0]);i++)
- {
- c=rx->rm_Args[0][i];
- if(c==' ')
- {
- Command[CmdCount++][Pos]=0x00;
- Pos=0;
- if(CmdCount>9) break;
- }
- else
- {
- if(Pos<49) Command[CmdCount][Pos++]=toupper(c);
- }
- }
- Command[CmdCount++][Pos]=0x00;
- for(i=CmdCount;i<10;i++) *Command[i]=0;
- Res1=0;
- Res2=0;
- iconify=0;
- /* --------------------------------------------------- */
- if(!(strcmp(&Command[0],"ICONIFY")))
- iconify=1;
- else if(!(strcmp(&Command[0],"UNICONIFY")))
- iconify=2;
- else if(!(strcmp(&Command[0],"ARCHIVE")))
- Gesamtkatalog();
- else if(!(strcmp(&Command[0],"CLICK")))
- {
- if(*Command[1]!=NULL)
- {
- if(!(strcmp(&Command[1],"PLAY")))
- {
- if(*Command[2]!=NULL)
- {
- i=atol(&Command[2]);
- if(Einstellungen.Funktion!=STANDBY)
- {
- if((i>=1)&&(i<=ThisCD->Anzahl))
- StopClicked();
- Einstellungen.Track=i;
- WiedergabeClicked();
- }
- }
- else
- WiedergabeClicked();
- }
- else if(!(strcmp(&Command[1],"STOP"))) StopClicked();
- else if(!(strcmp(&Command[1],"EJECT"))) AuswurfClicked();
- else if(!(strcmp(&Command[1],"NEXT"))) PlusClicked();
- else if(!(strcmp(&Command[1],"PREV"))) MinusClicked();
- else if(!(strcmp(&Command[1],"RND"))) TNumberClicked();
- else if(!(strcmp(&Command[1],"LOCK")))
- {
- if(*Command[2]!=NULL)
- {
- if(!(strcmp(&Command[2],"ON")))
- Einstellungen.Lock=1;
- else
- Einstellungen.Lock=0;
- AuswurfLock();
- ZeigeCDInfo();
- }
- else
- Res1=Res2=10;
- }
- else
- Res1=Res2=10;
- }
- else
- Res1=Res2=10;
- }
- else if(!(strcmp(&Command[0],"ABOUT")))
- {
- if(*Command[1]!=NULL)
- {
- if(!(strcmp(&Command[1],"CD"))) AboutCD();
- else if(!(strcmp(&Command[1],"DRIVE"))) AboutDrive();
- }
- else
- Information();
- }
- /* --------------------------------------------------- */
- rx->rm_Result1=Res1;
- rx->rm_Result2=Res2;
- ReplyMsg(rx);
- /* --------------------------------------------------- */
- rx=GetMsg(ARexxPort);
- }
- return(iconify);
- }
-
-